home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dbase / techs.zip / TECH19.ZIP / ERR_HIST.PRG next >
Text File  |  1985-11-02  |  2KB  |  66 lines

  1. * Program..: Err_hist.PRG
  2. * Author...: Jeffrey Bersin
  3. * Date.....: October 1, 1985
  4. * Version..: dBASE III, The Developer's Release
  5. * Note(s)..: Program to create an error history report
  6. *            when a dBASE III error has occurred during
  7. *            command file operation.
  8. *
  9. SET DOHISTORY OFF
  10. ? "An error has occured!  Please stand by..."
  11. SET CONSOLE OFF
  12. * ---Turn off ON ERROR, in case an error occurs in this program.
  13. ON ERROR
  14. * ---Setup alternate file name. 
  15. err_file = "E" + REPLICATE("0",2-LEN(LTRIM(STR(DAY(DATE()),2))));
  16.                + LTRIM(STR(DAY(DATE()),2)) + SUBSTR(TIME(),1,2);
  17.                + SUBSTR(TIME(),4,2) + SUBSTR(TIME(),7,1);
  18.                + ".ERR"
  19.  
  20. * ---Set and turn on Error File.
  21. SET ALTERNATE TO &err_file
  22. SET ALTERNATE ON
  23. * ---Display program status.
  24. ? DATE()
  25. ? TIME()
  26. ?
  27. ? REPLICATE( "=", 50 )
  28. ? "History listing"
  29. ? REPLICATE( "=", 50 )
  30. LIST HISTORY
  31. ? REPLICATE( "=", 50 )
  32. ? "Status Listing"
  33. ? REPLICATE( "=", 50 )
  34. LIST STATUS
  35. ? REPLICATE( "=", 50 )
  36. ? "Memory Listing"
  37. ? REPLICATE( "=", 50 )
  38. ? "BOF()= " 
  39. ?? BOF()
  40. ? "EOF()= "
  41. ?? EOF() 
  42. ? "RECNO()= "
  43. ?? RECNO()
  44. SET SAFETY OFF    
  45. * ---Saves the name of the Err_File.
  46. SAVE TO Temp      
  47. * ---Releases only memory variables created by this routine.
  48. RELEASE ALL       
  49. LIST MEMORY 
  50. ? REPLICATE("=",50)
  51. * ---Brings back the err_file memory variable.
  52. RESTORE FROM Temp
  53. SET SAFETY ON
  54. * ---Reset alternate file.
  55. SET ALTERNATE OFF
  56. SET ALTERNATE TO
  57. SET CONSOLE ON
  58. ON ERROR DO Err_hist
  59. ? "Error filename is " + CHR( 16 ) + err_file
  60. SET DOHISTORY ON
  61. * ---Pass control back to the calling routine.  This is where
  62. * ---you want to decide what to do next.  The RETURN statement
  63. * ---will return control to the statement immediately following 
  64. * ---the one that intiated the error. 
  65. RETURN
  66. * EOP Err_hist.PRG